
fetch('http://chst.vip:1234/api/getinlanddiscount')
.then(body=>body.json())
.then(res=>{
    console.log(res);
    let data = res.result
    let html=''
    mainBody = document.querySelector('#mainBody')

    data.forEach(item=>{
        html+=`
        <div id="minMain">
        <a href='国内折扣详情.html?productid=${item.productId}'}>
        ${item.productImg}
            <div>${item.productName}</div>
            <p id="price">${item.productPrice}</p>
            <p>${item.productFrom} | ${item.productTime}</p>
        </a>
    </div>
        `
    })
    mainBody.innerHTML = html
})